<%@include file='header.jsp'%>

<jsp:include page='top_nav.jsp'/>

<div id="container">
	
	<div id="addBookmark">
		
		<div id="aerr" class="err">
			<c:if test="${! empty aerrors}">
				<c:forEach items="${aerrors}" var="error">
					<p><c:out value="${error}"/></p>
				</c:forEach>
			</c:if>
		</div>
		
		<p><h2>Add Bookmark: </h2></p>
		
		<form action="addBookmark.do" method="post">
			<table>
				<tr>
					<td>
						URL:
					</td>
					<td>
						<input type="text" name="uRL"/>
					</td>
					
				</tr>
				<tr>
					<td>
						Comment:
					</td>
					<td>
						<input type="textarea" name="comment"/>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<input type="submit" name="button" value="submit"/>
					</td>
				</tr>
			</table>
		</form>		
	</div>
	
	
	<div id="manageContent">
	
		<p><h2><c:out value="${user.userEmail}" />'s Bookmark</h2></p>
		
		<jsp:include page="error.jsp" />
		
		<table id="bookmarksTable">
			<c:forEach items="${managingBookmarks}" var="bookmark">
				<tr>
					<td>
						<table>
							<tr>
								<td colspan=2>
									<img src="http://www.shrinktheweb.com/xino.php?embed=1&STWAccessKeyId=36e93fc92e770e1&Size=m&Url=${bookmark.URL}" alt="MyBookmarks" class="google"/>
								</td>
							
								<td>
									<table id="bookmarkDetail">
										<tr>
											<td>
												Website: 
											</td>
											<td>
												<a href="http://${bookmark.URL}" target="_blank"><c:out value="${bookmark.URL}" /></a>
											</td>
										</tr>
										<tr>
											<td>
												Click: 
											</td>
											<td>
												<c:out value="${bookmark.clickCount}" />
											</td>
										</tr>
										<tr>
											<td>
												Comment:
											</td>
											<td>
												<c:out value="${bookmark.comment}" />
											</td>
										</tr>
										<tr>
											<td>
												<span id="delete"><a href="delBookmark.do?did=${bookmark.id}">Delete</a></span>
											</td>
										</tr>										
									</table>
								</td>
							</tr>
						</table>
					</td>				
				</tr>
			</c:forEach>
		</table>	
	</div>
	

</div>

<%@include file='footer.jsp'%>
